package com.wocao.controller;

import com.wocao.entity.ResponseResult;
import com.wocao.entity.ZyComment;
import com.wocao.service.ZyCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.math.BigInteger;

/**
 * 评论表 前端控制器
 */
@RestController
@RequestMapping("/zyComment")
public class ZyCommentController {

    @Autowired
    private ZyCommentService zyCommentService;

    //删除评论
    @DeleteMapping("comment/{id}")
    public ResponseResult remove(@PathVariable BigInteger id){
        ZyComment comment = zyCommentService.getById(id);
        comment.setDelFlag(1);
        zyCommentService.updateById(comment);
        return ResponseResult.ok();
    }

}
